package com.spring.utils.api_v4.controller.ui;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spring.utils.api_v4.pojo.salary.task.DeptWageTask;
import com.spring.utils.api_v4.pojo.UserInfo;
import com.spring.utils.api_v4.util.DoubleSerialize;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;

/**
 * 个人工资
 */
@Getter
@Setter
public class SalaryItem {
    private String id;
    @Setter
    private String userId;          // 用户编号
    @JsonIgnore
    private UserInfo userInfo;      // 用户编号
    @Setter
    private String taskId;          // 所属任务
    @JsonIgnore
    private DeptWageTask task;      // 所属任务
    @JsonSerialize(using = DoubleSerialize.class)
    private double meritPay;        // 绩效工资
    private String note = "无";      // 说明
    private LocalDate createDate;   // 创建时间
    private int state;              // 状态

    public String getDept() {
        return userInfo.getDepart().getName();
    }
    public String getUserId() {
        return userInfo.getId();
    }
    public String getName() {
        return userInfo.getName();
    }
    public String getTaskId() {
        return task.getId();
    }
    public int getAge() {
        return userInfo.getAge();
    }
    public String getSex() {
        return userInfo.getSex();
    }
}